70b0b675aaa71981b0d515b82f2b867de5dabf9a,thymeleaf-extras-springsecurity4/src/main/java/org/thymeleaf/extras/springsecurity4/dialect/processor/AuthorizeUrlAttrProcessor.java,AuthorizeUrlAttrProcessor,isVisible,#Arguments#Element#String#,65
Before Change
protected boolean isVisible(final Arguments arguments, final Element element,
final String attributeName) {
String attributeValue = element.getAttributeValue(attributeName);
if (attributeValue == null || attributeValue.trim().equals("")) {
return false;
}
attributeValue = attributeValue.trim();
final int spaceIndex = attributeValue.indexOf(' ');
final String url =
(spaceIndex < 0? attributeValue : attributeValue.substring(spaceIndex + 1)).trim();
final String method =
(spaceIndex < 0? "GET" : attributeValue.substring(0, spaceIndex)).trim();
final IContext context = arguments.getContext();
if (!(context instanceof IWebContext)) {
throw new ConfigurationException(
"Thymeleaf execution context is not a web context (implementation of " +
IWebContext.class.getName() + ". Spring Security integration can only be used in " +
After Change
@Override
protected boolean isVisible(
final ITemplateProcessingContext processingContext, final IProcessableElementTag tag,
final AttributeName attributeName, final String attributeValue) {
final String attrValue = (attributeValue == null? null : attributeValue.trim());
if (attrValue == null || attrValue.equals("")) {
return false;
}
final int spaceIndex = attrValue.indexOf(' ');
final String url =
(spaceIndex < 0? attrValue : attrValue.substring(spaceIndex + 1)).trim();
final String method =
(spaceIndex < 0? "GET" : attrValue.substring(0, spaceIndex)).trim();
if (!processingContext.isWeb()) {
throw new ConfigurationException(
"Thymeleaf execution context is not a web context (implementation of " +
IWebContext.class.getName() + "). Spring Security integration can only be used in " +
"web environments.");
}
final IWebContext webContext = (IWebContext) processingContext.getVariablesMap();
final HttpServletRequest request = webContext.getRequest();
final ServletContext servletContext = webContext.getServletContext();